<?php
App::uses('AppModel', 'Model');
/**
 * Productscategory Model
 *
 */
class Productscategory extends AppModel {

	public $displayField = 'name';
	
/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
        'name' =>array(
            'name-1' => array(
                'rule' => array('notempty'),
                'message' => 'Please enter a category name',
                'last' => true,
            ),
			'name-2' => array(
                'rule'    => 'isUnique',
                'message' => 'This category name already exists.'
            ),      
		),       
	);
}
